<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Talking 后台管理 -- 我们致力于打造最专业的贴吧</title>
<link rel="stylesheet" href="./static/css/frame.css" />
<script src="./static/js/jquery-1.3.min.js"></script>
<script src="./static/js/jquery.form.js"></script>
<script src="./static/js/common.js"></script>
<script>
$(document).ready(function(){
    var options = {                        
        dataType     : 'json',
        beforeSubmit : validate,
        success      : initTable
    };
    $('#btnSubmit').click(function(){ 
        $('#form').ajaxSubmit(options);
    });
    $('#pageNext').click(function(){
        var current = $('#current').val();
        current = parseInt(current); 
        $('#form').ajaxSubmit({   
            data         : {current : current+1,submit : 'page'},                                       
            dataType     : 'json',
            success      : initTable
        });
    });
    $('#pagePrev').click(function(){ 
        var current = $('#current').val(); 
        current = parseInt(current);  
        $('#form').ajaxSubmit({                                        
            data         : {current : current-1,submit : 'page'},                                      
            dataType     : 'json',
            success      : initTable
        });
    });
    $('#addLink').click(function(){
        $('.list tr:last').before("<tr>"+
        "<td></td>"+
        "<td><input type='text' style='width:90%;' name='word[ ]' /></td>"+
        "<td><input type='text' style='width:90%;' name='insteadWord[ ]' /></td>"+
        "<td></td>"+
        "</tr>");
        if($('body').height()>=500){
            top.resizeFrame();
        }
    });
    $('#chkDel').click(function(){
        if($(this).attr('checked')==true){
            $('input[type=checkbox]').each(function(i){
                $(this).attr('checked','checked');
            });
        }
        else{
            $('input[type=checkbox]').each(function(i){
                $(this).removeAttr('checked');
            });
        }
    });
});
</script>
</head>

<body>
<div id="content">
    <div class="title">帖子 » 词语过滤</div>
    <div class="main">
        <h3>词语过滤</h3>                  
        <form action="./word_filter.php" name="form" method="post" id="form">
        <input type="hidden" name="submit" value="add" />
        <input type="hidden" id='current' value="{{$current}}" />
        <table cellpadding="0" cellspacing="0" class="list">
            <tbody>
                <tr>
                    <td width="30" align="center">删除</td>
                    <td>不良词语</td>
                    <td>替换为</td>
                    <td width="70" align="center">操作者</td>
                </tr>
                {{section name=n loop=$filters}}
                <tr>
                    <td align="center">
                        <input type="checkbox" name="del[ ]" value="{{$filters[n].FilterID}}" />
                    </td>
                    <td>{{$filters[n].FilterWords}}</td>
                    <td>{{$filters[n].FilterInsteadWords}}</td>
                    <td align="center">{{$filters[n].FilterManager}}</td>
                </tr>
                {{/section}}
                <tr>
                    <td align="center"><input type="checkbox" id="chkDel" /></td>
                    <td colspan="4">
                        <a href="javascript:void(0)" id="addLink">添加关键词过滤</a>
                        <a href="javascript:void(0)" style="float: right;" id="pageNext">下一页</a>
                        <a href="javascript:void(0)" style="float: right; margin-right: 20px;" id="pagePrev">上一页</a>
                    </td>
                </tr>
            </tbody>
        </table>
        <p>
            <input type="button" class="button_submit" id="btnSubmit" value="提交" />  
        </p> 
        </form>
         
        <h3>关键词导入</h3>
        <fieldset>                  
        <form action="./word_filter.php" name="form" method="post" id="form" enctype="multipart/form-data">
        <input type="hidden" name="submit" value="import" />
            <p>
                <input type="file" name="file_upload" id="file_upload" />
                <span>请上传txt格式文件,关键词格式为(不良词语=替换词语)</span>
            </p>
        </form>
        </fieldset>      
    </div>
</div>
</body>
</html>
